<template>
	<view class="content">
		<uni-list>
			<uni-list-item showArrow title="手机号" link>
				<template v-slot:footer>
					<text> {{user.phone}}</text>
				</template>
			</uni-list-item>
		</uni-list>
		<uni-list class="app">
			<uni-list-item title="设置密码" showArrow @click="toPassword" link />
		</uni-list>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: {}
			}
		},
		methods: {
			//跳转修改密码页面
			toPassword() {
				uni.navigateTo({
					url: "/pages/user/updatePwd"
				})
			}
		},
		onLoad() {
			this.user = this.$store.state.userInfo
			let reg = /^(\d{3})\d*(\d{2})$/;
			this.user.phone = this.user.telephone.replace(reg, '$1****$2')
		}
	}
</script>
<style scoped lang="less">
	.content {
		width: 100%;
		height: 100%;

		.app {
			margin-top: 10upx;
		}


		.exit {
			margin-top: 10upx;
		}
	}
</style>